package com.bp.exam.controller.user;

import com.bianmaba.spring.data.jpa.domain.Result;
import com.bianmaba.spring.mvc.method.support.annotations.JSON;
import com.bp.exam.aop.ILog;
import com.bp.exam.controller.supports.DefaultCrudController;
import com.bp.exam.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 资料
 */
@RestController
@Api(description = "the DescorationInformation API", tags = "App 资料相关接口")
@RequestMapping(value = {"/user"})
public class UserController extends DefaultCrudController implements ILog {




    @ApiOperation(value = "查询资料列表", nickname = "查询资料列表",response = String.class)
    @RequestMapping(value = "allInfo",method = RequestMethod.POST,produces = {"application/json"})
    @JSON(excludeProperties = {"data.*\\.files","data.*\\.outputFile","data.*\\.type" ,"data.*\\.children\\*.children","data.*\\.parent","data.*\\.core"})
    public Result allInfo()
    {
        return  ResultUtil.returnSuccess("成功");

    }

    @ApiOperation(value = "保存上传数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "param", value = "{\n" +
                    "\t\"projectId\": \"4028736c64f3a3010164fd93739d005f\",\n" +
                    "\t\"termId\": \"4028736c64f3a3010164fd9374ea0063\",\n" +
                    "\t\"buildingId\": \"402880e964fea9f70164feaff52d0000\",\n" +
                    "\t\"unitId\": \"402880e964fea9f70164feb0484d0001\",\n" +
                    "\t\"infoId\": 整型 2" +
                    "\t\"loft\": \"2,3,4,5,6\"\n" +
                    "}", dataType = "json", paramType = "query"),
            @ApiImplicitParam(name = "imageFile", value = "文件数组", dataType = "file", paramType = "query")
    })
    @RequestMapping(value = "/saveInfo",
            produces = {"application/json"},
            method = RequestMethod.POST)
    public Result saveInfo(MultipartFile[] imageFile, String param) {

        return  ResultUtil.returnSuccess("上传成功");

    }

}
